<?php
class Slash_Config
{
	
	private $defaultAcl;
	private $rootDirectory;
	private $principalRoot;
	private $calendarRoot;
	private $authRealm;
	private $aclRestrictions;
	private $defaultAdminPassword;
	
	public function __construct()
	{
		/*
		 * The defaultAcl is set on all newly-created resources.
		 * 		owner->grant all protected
		 * 		admins->grant all protected
		 * 
   * Copyright © 2010 Jack Cleaver
   * 
   * This plugin provides functionality added by CalDAV (RFC 4791)
   * It implements new reports, and the MKCALENDAR method.
   *
   * This file is part of Slash.
   *
   * Slash is free software: you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
   * the Free Software Foundation, either version 3 of the License, or
   * (at your option) any later version.
   *
   * Slash is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
   *
   * You should have received a copy of the GNU General Public License
   * along with Slash.  If not, see <http://www.gnu.org/licenses/>.
		 */
		$this->defaultAcl = new Slash_ACL_Property_Acl("Default ACL");
		$princ = new Slash_ACL_Property_PropertyPrincipal("DAV:", "owner");
		$this->defaultAcl->grant($princ, array(0=>"all"), true);
		
		$princ = new Slash_ACL_Property_HrefPrincipal("/principals/admins");
		$this->defaultAcl->grant($princ, array(0=>"all"), true);
		
		/*
		 * For ACL only, use a Slash_ACL_FSExt_Directory.
		 * For CalDAV support, use a Slash_CalDAV_FSExt_Directory.
		 */
		$this->rootDirectory = 'public';
		
		$this->principalRoot = "principals";
		
		$this->calendarRoot = "calendars";
		
		$this->authRealm = "Slash";
		
		$this->defaultAdminPassword = "admin";
		
		$this->baseUri = "/";
		
		$requiredPrincs = array();
		$requiredPrincs[] = new Slash_ACL_Property_PropertyPrincipal("DAV:", "owner");
		$requiredPrincs[] = new Slash_ACL_Property_HrefPrincipal("/principals/admins");
		$this->aclRestrictions = new Slash_ACL_Property_AclRestrictions(true, true, false, $requiredPrincs);		
		
	}
	
	public function getDefaultAcl()
	{
		return $this->defaultAcl;
	}
	
	public function getDefaultAdminPassword()
	{
		return $this->defaultAdminPassword;
	}
	
	public function getRootDirectory()
	{
		return $this->rootDirectory;
	}
	
	public function getPrincipalRoot()
	{
		return $this->principalRoot;
	}
	
	public function getCalendarRoot()
	{
		return $this->calendarRoot;
	}
	
	public function getAuthRealm()
	{
		return $this->authRealm;
	}
	
	public function getBaseUri()
	{
		return $this->baseUri;
	}
	
	public function getAclRestrictions()
	{
		return $this->aclRestrictions;
	}
}
	

	